{extend name="layout/main-block" /}
<!-- main content start -->
{block name="content"}
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li class="h4"><a href="">{$menu_name_cn}</a></li>
                <li class="h4"><a href="">新建子分类</a></li>
            </ol>

        </div>
        <div class="row content-main">
            <div class="col-sm-12 col-md-6">
                <form class="form-horizontal" action="{:url('backend/modules/tab_create',['menu_id'=>$menu_id])}" enctype="multipart/form-data" method="post">
                    <div class="form-group">
                        <div class="col-sm-9">
                            <input type="hidden" name="p_id" id="p_id" value="{$p_id}">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-9">
                            <input type="hidden" name="full_id" id="full_id" value="{$full_id}">
                        </div>
                    </div>
                    <input type="hidden" name="sort" class="form-control" id="inputSort">
                    <div id="menu" style="display: none">
                        <div class="form-group">
                            <label for="inputMenu_name_cn" class="col-sm-3 control-label">分类名称中文</label>
                            <div class="col-sm-9">
                                <input type="text" name="menu_name_cn" class="form-control" id="inputMenu_name_cn" placeholder="分类名称中文...">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputMenu_name_en" class="col-sm-3 control-label">分类名称英文</label>
                            <div class="col-sm-9">
                                <input type="text" name="menu_name_en" class="form-control" id="inputMenu_name_en" placeholder="分类名称英文...">
                            </div>
                        </div>
                    </div>
                    <div id="tab" style="display: block">
                        <div class="form-group">
                            <label for="inputTab_name_cn" class="col-sm-4 control-label">子分类名称中文</label>
                            <div class="col-sm-8">
                                <input type="text" name="tab_name_cn" class="form-control" id="inputTab_name_cn" placeholder="子分类名称中文...">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputTab_name_en" class="col-sm-4 control-label">子分类名称英文</label>
                            <div class="col-sm-8">
                                <input type="text" name="tab_name_en" class="form-control" id="inputTab_name_en" placeholder="子分类名称英文...">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-4 col-sm-8">
                            <button type="submit" class="btn btn-primary">创 建</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
</section>
{/block}

{block name="javascript"}
<script type="text/javascript" >
    $(function (){
        //url中的menu_id或者id
        var p_id = $('#p_id').val();
        //全时全程的ID
        var full_id = $('#full_id').val();
        if(p_id == full_id){
            $("#menu").show();
            $("#tab").hide();
        }else{
            $("#menu").hide();
            $("#tab").show();
        }
    })
</script>
{/block}

